#!/usr/bin/env python
from sys import argv
from os import system,listdir

if len(argv) != 2:
	print argv[0]+" bin_name.bin"
else:
	a = open("maker.sh","w")
	a.write("gcc -o "+argv[1]+" *.c -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lm -lpangocairo-1.0 -lfontconfig -lXext -lXrender -lXinerama -lXi -lXrandr -lXcursor -lXfixes -lpango-1.0 -lcairo -lX11 -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0 -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include")
	a.close()
	dirs = listdir(".")
	for b in dirs:
		if b.endswith(".c") or b.endswith(".h"):
			lines = []	
			a = open(b,"rw")
			c = a.readlines()
			for d in c:
				if "#include" in d and "(null)" in d:
					d = "//"+d
				elif "PACKAGE_DATA_DIR" in d:
					d = "//"+d	
				elif "support.h" in d:
					d = "//"+d	
				lines.append(d)
			a.close()
			a = open(b,"w")
			for c in lines:
				a.write(c)
			a.close()
	print "done"
